package server.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import server.demo.mapper.UserMapper;
import server.demo.model.Role;
import server.demo.model.SysUser;

import java.util.List;

@RestController
@SpringBootApplication
public class server {

    @Autowired
    private UserMapper userService;

    public static void main(String[] args) {
        SpringApplication.run(server.class, args);
    }

    @RequestMapping("/index")
    public SysUser getall(){
            return userService.getUserByName("admin");
    }

    @RequestMapping("/test")
    public List<Role> test(){

        return userService.selectRoleId(1);
    }
//    @RequestMapping("/login")
//    public ModelAndView login(){
//        ModelAndView m=new ModelAndView("/login.html");
//        return m;
//    }
}
